import java.io.IOException;
import java.util.Map;
import java.util.TreeMap;

public class TcpDictServer extends TcpEchoServer {
    private Map<String,String> dict=new TreeMap<>();
    public TcpDictServer(int port) throws IOException {
        super(port);
        dict.put("小猫","cat");
       dict.put("小狗","dog");
    }
    @Override
    public String process(String request) {
        return dict.getOrDefault(request,"该词不存在");

    }

    public static void main(String[] args) throws IOException {
        TcpDictServer server=new TcpDictServer(9090);
        server.start();
    }
}
